package com.foxshooter;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;

public class StartWebUtil {
	
	public static void init() throws IOException{
		File srcDir = new File("src/main/webapp");
		File destDir = new File("target/webapp");
		if(destDir.exists()){
			FileUtils.deleteDirectory(destDir);
		}
		FileUtils.copyDirectory(srcDir, destDir);
		
		File srcDir2 = new File("src/main/resources");
		File destDir2 = new File("target/webapp/WEB-INF/classes/");
		if(destDir2.exists()){
			FileUtils.deleteDirectory(destDir2);
		}
		FileUtils.copyDirectory(srcDir2, destDir2);
	}
	
}
